Type.registerNamespace('ModWatch');

ModWatch.RadioButtonListModWatcherBehavior = function(element) { 
    ModWatch.RadioButtonListModWatcherBehavior.initializeBase(this, [element]);

    this._valueToCompare = null;
}

ModWatch.RadioButtonListModWatcherBehavior.prototype = {

	get_valueToCompare : function() {
		return this._valueToCompare;
	},

	set_valueToCompare : function(value) {
		this._valueToCompare = value;
	},

	hasChanged : function() {
		var i = 0;
		var idBase = this.get_element().id + '_';
		
		var elem = Sys.UI.DomElement.getElementById(idBase + i);

		while (elem)
		{
			if (elem.checked)
				return (elem.value != this._valueToCompare);

			i++;
			elem = Sys.UI.DomElement.getElementById(idBase + i);
		}
		return (this._valueToCompare != null);
	}

}

ModWatch.RadioButtonListModWatcherBehavior.registerClass('ModWatch.RadioButtonListModWatcherBehavior', ModWatch.ModWatcherBehaviorBase);

if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
